<?php

namespace App\Traits;

use http\Client\Response;

trait Restful
{
    public function sendData($data = [], $msg = '数据请求成功', $code = 200)
    {
        $data = [
            'code' => $code,
            'msg'  => $msg,
            'data' => $data,
        ];
        return response()->json($data);
    }
}
